package com.rightsidetech.http.wechatutil;

import com.rightsidetech.commom.utils.StringUtil;

/**
 * @Author: yinj
 * @Date: 2021-12-20 16:10:36
 * @Description: 订阅消息模板常量
 */
public enum MsgTemplatesEnum {
    /**
     * 订阅消息模板常量
     */
    CANCEL_ORDER(1,"您有订单待支付，10分钟后将自动取消","3vZ_t70wGcdvPTzYgF4V1h7ImRCrE6wLy6CIy-2e3nU"),
    COUNPON_COLLECT(2,"优惠券到账通知","KOmzWEQz5pkADq6y318G36va2TwsToOgOn8VkY3stvM"),
    REFUND_ORDER(3,"退款订单",""),
    COUNPON_OVERDUE(4,"优惠券过期","")
    ;


    private Integer typeId;
    private String templateId;
    private String describe;

    MsgTemplatesEnum(Integer typeId, String describe, String templateId ) {
        this.typeId= typeId;
        this.templateId= templateId;
        this.describe= describe;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    public String gettemplateId() {
        return templateId;
    }
    public void settemplateId(String templateId) {
        this.templateId = templateId;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }
    public static MsgTemplatesEnum parse(String templateId) {
        if (StringUtil.isNullorEmpty(templateId)) {
            return null;
        }
        MsgTemplatesEnum rtype = null;
        for (MsgTemplatesEnum type : MsgTemplatesEnum.values()) {
            if (type.gettemplateId().equals(templateId)) {
                rtype = type;
            }
        }
        return rtype;
    }
}
